# -*- makefile -*-

LIBUTL/     :=$(realpath $/../libutil/)/
LIBBIO/     :=$(realpath $/../libbio/)/
LIBSEQ/     :=$(realpath $/../libseq/)/
LIBMERYL/   :=$(realpath $/../libmeryl/)/

src := $/existDB-create-from-fasta.C \
       $/existDB-create-from-meryl.C \
       $/existDB-create-from-sequence.C \
       $/existDB-state.C \
       $/existDB.C \
       $/existDB.H \
       $/merTable.H \
       $/positionDB-access.C \
       $/positionDB-dump.C \
       $/positionDB-file.C \
       $/positionDB-mismatch.C \
       $/positionDB-sort.C \
       $/positionDB.C \
       $/positionDB.H

$/.CXX_SRCS   := $(filter %.C,${src}) $/driver-existDB.C $/driver-posDB.C $/percentCovered.C $/kmer-mask.C
$/.CXX_INCS   := $(filter %.H,${src})
$/.CXX_EXES   := $/existDB $/positionDB $/percentCovered $/kmer-mask
$/.CXX_LIBS   := $/libkmer.a
$/.CLEAN      := $/*.o

$/libkmer.a:      $(filter %.o,${src:.C=.o})
$/existDB:        $/driver-existDB.o $/libkmer.a ${LIBMERYL/}libmeryl.a ${LIBSEQ/}libseq.a ${LIBBIO/}libbio.a ${LIBUTL/}libutil.a 
$/positionDB:     $/driver-posDB.o   $/libkmer.a ${LIBMERYL/}libmeryl.a ${LIBSEQ/}libseq.a ${LIBBIO/}libbio.a ${LIBUTL/}libutil.a 
$/percentCovered: $/percentCovered.o $/libkmer.a ${LIBMERYL/}libmeryl.a ${LIBSEQ/}libseq.a ${LIBBIO/}libbio.a ${LIBUTL/}libutil.a 
$/kmer-mask:      $/kmer-mask.o      $/libkmer.a ${LIBMERYL/}libmeryl.a ${LIBSEQ/}libseq.a ${LIBBIO/}libbio.a ${LIBUTL/}libutil.a 

$(eval $/%.d $/%.o:    CXXFLAGS+= -I${LIBMERYL/} -I${LIBBIO/} -I${LIBSEQ/} -I${LIBUTL/})
